import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';

@Injectable({ providedIn: 'root' })
export class GlobalSpinService {
  private spin$ = new Subject<boolean>();
  public spinChange$ = this.spin$.asObservable();

  constructor() {}

  public pulish(isSpinning: boolean = false): void {
    this.spin$.next(isSpinning);
  }
}
